WebStorage

public interface WebStorage

An HTML WebStorage.

Provides access to the session storage or local storage for a particular document on the loaded web page. Allows you to add, modify, or delete the stored items.

Since

7.1

Functions

Link copied to clipboard
public abstract void clear()
Removes all the items from the storage.
Link copied to clipboard
public abstract boolean contains(String key)
Returns true if the storage contains an item with the specified key, otherwise false.
Link copied to clipboard
public abstract Optional<String> item(String key)
Returns an Optional that contains the value associated with the given key if it exists in the storage, otherwise an empty Optional.
Link copied to clipboard
public abstract Optional<String> key(int index)
Returns an Optional that contains the name of the key by the specified index if it exists in the storage, otherwise an empty Optional.
Link copied to clipboard
public abstract int length()
Returns the number of key/value pairs in the storage.
Link copied to clipboard
public abstract void putItem(String key, String value)
Adds the item with the specified key and value to the storage, or updates it if the item with the given key already exists.
Link copied to clipboard
public abstract void removeItem(String key)
Removes the item with the specified key from the storage.